// url ,method,header,data
module.exports = function http(url, method, data) {
  url = "http://192.168.0.44:2022/dev-api/" + url
  let header = {
    'content-type': 'application/x-www-form-urlencoded'
  }
  const service = new Promise((resolve, reject) => {
    wx.request({
      url,
      method,
      data,
      header,
      success: (res) => {
        resolve(res.data)
      },
      fail: (err) => {
        reject(err)
      }
    })
  })
  return service
}
